home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu086.dms / pu086.adf / bin / cc.doc < prev    next >
Text File  |  1990-12-02  |  4KB  |  155 lines

  1.  
  2.   (c) 1990 S.Hawtin.
  3.   Permission is granted to copy this file provided that:
  4.    1) It is not used for commercial gain
  5.    2) This notice is included in all copies
  6.    3) Altered copies are marked as such.
  7.  
  8.   No liability is accepted for the contents of the file.
  9.  
  10.   cc.doc        within        CC
  11.  
  12.  
  13.  
  14. CC
  15.  
  16.  
  17.      cc [-ofilename][-c][-s][-rlibdir][-llibname] file1 file2 ...
  18.  
  19.   A front end for the 'C' language, it is used to control the compiler
  20. assembler and linker.  The options have the following meanings
  21.  
  22.  
  23.   -o<filename>
  24.  
  25.     Write the linker output to the file <filename>.
  26.  
  27.  
  28.   -c
  29.  
  30.     Compile and assemble the file, but do not link it.
  31.  
  32.  
  33.   -s
  34.  
  35.     Compile the file but do not assemble it.
  36.  
  37.  
  38.   -?
  39.  
  40.     Just test cc, if this flag is set the program will print out the commands
  41.   it would have executed.  Useful for a quick play to see what cc does.
  42.  
  43.  
  44.   -n<flag>
  45.  
  46.     Pass the flag to the NorthC program, for example "cc -n-c foo.c" will call
  47.   "NorthC -c foo.c".
  48.  
  49.  
  50.   -a<flag>
  51.  
  52.     Pass the flag to the assembler.
  53.  
  54.  
  55.   -b<flag>
  56.  
  57.     Pass the flag to the linker.  Try using the flags "-bVERBOSE" and
  58.   "-bSMALLCODE" for example, see "blink.doc" for details.
  59.  
  60.  
  61.   -r<libdir>
  62.  
  63.     Use the libraries in the <libdir> directory.  NOTE the name of this
  64.   directory must end in ':' or '/' so that cc can just add filenames to it,
  65.   the default value is "clibs:".  The "clibs:" logical device is initialised by
  66.   the "setup-NorthC" or "Single-Disk" script files.
  67.  
  68.  
  69.   -l<libname>
  70.  
  71.     Link the library libname, libraries should be created with ar.  As an 
  72.   example "cc -lX11 foo.o" will use the file "clibs:libX11.a" as a library,
  73.   if you have such a library.
  74.  
  75.  
  76.   The types of the files are determined by thier extensions,
  77.  
  78.     *.c        A 'C' source file
  79.     *.i        A preprocessed 'C' file
  80.     *.s        An assembler file
  81.     *.asm    An assembler file
  82.  
  83. all other input filenames are treated as object files.  Because NorthC
  84. does not have a seperate preprocessor stage *.i files are treated as
  85. 'C' source files.  cc will delete any intermediate files that it produces,
  86. this might cause problems if you have "foo.c" and "foo.s" as seperate
  87. source files.
  88.  
  89.  
  90.  
  91.   Some examples of this program in action will explain its behaviour,
  92.  
  93.  
  94.     cc ar.c
  95.  
  96.   This command will compile, assemble and link the file "ar.c", this will 
  97. create a program "a.out".  The intermediate files "ar.s" and "ar.o" will be
  98. deleted once they have been used.
  99.  
  100.  
  101.     cc -c ar.c foo.asm
  102.  
  103.   This command will compile and assemble the file "ar.c", creating a file
  104. "ar.o".  In addition it will assemble the file "foo.asm" creating a file
  105. "foo.o".  The -c option will prevent the cc program calling the linker.
  106.  
  107.  
  108.     cc -ofrob ar.o foo.o -lmylib
  109.  
  110.   This command will link the files "ar.o" and "foo.o" with the library
  111. "clibs:libmylib.a" to create an executable file "frob".
  112.  
  113.  
  114.     cc -ofrob -r:libs/libc/ ar.c foo.asm
  115.  
  116.   This command will compile and assemble the file the file "ar.c", assemble
  117. the file "foo.asm", then link the files ":libs/libc/crt0.o" "ar.o" and 
  118. "foo.o" with the library ":libs/libc/libc.a".  The file "crt0.o" and the 
  119. library "libc.a" are always linked when cc calls the linker, they contain 
  120. the startup code for NorthC and the standard 'C' library.
  121.  
  122.  
  123.     cc -bSMALLCODE -ojim foo.o bar.o
  124.  
  125.   This command will link the files "foo.o" and "bar.o", it will use the 
  126. command "blink clibs:crt0.o foo.o bar.o SMALLCODE  TO jim LIB clibs:libc.a", 
  127. this allows you to pass flags to the linker that cc will not try to 
  128. interpret as filenames.
  129.  
  130.  
  131.     cc -? foo.c bar.c baz.asm
  132.  
  133.   This command will not execute any system calls at all, the command will
  134. print out a list of the commands it would have issued to perform this function.
  135. This command is of most use when you have altered "cc.c" to test that it is
  136. behaving as you expect.  If you are interested in how cc works you should
  137. use the "-?" flag.
  138.  
  139.  
  140. FUTURE
  141.  
  142.   Since I now have a version of "make" that does not call "cc" I do not
  143. intend to do any more work on this program.
  144.  
  145.  
  146. BUGS
  147.  
  148.   The system() function does not return the exit code of the program it
  149. calls.  If one of the earlier tools fails cc will just carry on 
  150. regardless.  This is because I have not got enough documentation on the
  151. Amiga operating system to find out how to use Execute().
  152.  
  153.   The extension comparison is case sensitive, a command "cc -c FOO.C" will
  154. treat "FOO.C" as an object module.
  155.